package Beans;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "branch")
public class Branch {

	private int branchId;
	private int smsPlatform;
	private String branchName;
	private String branchShortAddress;
	private String branchAddress;
	private String branchProvince;
	private String branchCity;
	private String linkMan;
	private String linkNum;
	private Agent agent;
	private Estate estate;
	private int isAcross;
	private int status;

	@GenericGenerator(name = "generator", strategy = "native")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "branch_id", unique = true, nullable = false)
	public int getBranchId() {
		return branchId;
	}

	public void setBranchId(int branchId) {
		this.branchId = branchId;
	}

	@Column(name = "branch_name")
	public String getBranchName() {
		return branchName;
	}

	public void setBranchName(String branchName) {
		this.branchName = branchName;
	}

	@Column(name = "branch_shortAddr")
	public String getBranchShortAddress() {
		return branchShortAddress;
	}

	public void setBranchShortAddress(String branchShortAddress) {
		this.branchShortAddress = branchShortAddress;
	}

	@Column(name = "branch_addr")
	public String getBranchAddress() {
		return branchAddress;
	}

	public void setBranchAddress(String branchAddress) {
		this.branchAddress = branchAddress;
	}

	@Column(name = "branch_province")
	public String getBranchProvince() {
		return branchProvince;
	}

	public void setBranchProvince(String branchProvince) {
		this.branchProvince = branchProvince;
	}

	@Column(name = "branch_city")
	public String getBranchCity() {
		return branchCity;
	}

	public void setBranchCity(String branchCity) {
		this.branchCity = branchCity;
	}

	@Column(name = "branch_linkMan")
	public String getLinkMan() {
		return linkMan;
	}

	public void setLinkMan(String linkMan) {
		this.linkMan = linkMan;
	}

	@Column(name = "branch_linkNum")
	public String getLinkNum() {
		return linkNum;
	}

	public void setLinkNum(String linkNum) {
		this.linkNum = linkNum;
	}

	@Column(name = "branch_smsplatform")
	public int getSmsPlatform() {
		return smsPlatform;
	}

	public void setSmsPlatform(int smsPlatform) {
		this.smsPlatform = smsPlatform;
	}

	@ManyToOne
	@JoinColumn(name = "branch_agent_id")
	public Agent getAgent() {
		return agent;
	}

	public void setAgent(Agent agent) {
		this.agent = agent;
	}

	@ManyToOne
	@JoinColumn(name = "branch_estate_id")
	public Estate getEstate() {
		return estate;
	}

	public void setEstate(Estate estate) {
		this.estate = estate;
	}

	@Column(name = "branch_isAcross")
	public int getIsAcross() {
		return isAcross;
	}

	public void setIsAcross(int isAcross) {
		this.isAcross = isAcross;
	}

	@Column(name = "branch_status")
	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public void print() {
		System.out.println("-----------------------------");
		System.out.println("branchName: " + branchName);
		System.out.println("branch_short_address: " + branchShortAddress);
		System.out.println("branch_Address: " + branchAddress);
	}

}
